<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title>Aikes_系统</title>
<link rel="stylesheet" href="css/style.css" type="text/css" media="all" />
<script src="css/js/jquery.min.js"></script>
<script type="text/javascript">
var index = 0;
$(function(){
		title();
		setInterval(title, 2000);
	});
function title(){
		index++; 
		$.ajax({
			"url" : "title.sls",
			"type" : "post",
			"data" : {"index":index},
			"dataType" : "json",
			"success" : function(result) {
				$("#tbody").empty();
				var list = result.data;
				for (var i = 0; i < list.length; i++) {
					var s = list[i];
					//更新表格
					$("#tbody").append(
							'<tr><td><a onclick="detail(this)" style="text-decoration: none;">'+
							s.title+'</a></td><td>'+
							s.comdate+'</td><td><input type="hidden" value="'+
							s.companyId+'" /></td></tr>'
					);
				}
			},
			error : function(){
				window.location.href="error.sls";
			}
		});
	};
	function detail(btn){
	 	var ss = btn.parentNode.parentNode;
		var inputs = ss.getElementsByTagName("input");
		var id = inputs[0].value;
		$.ajax({
			"url" : "detail.sls",
			"type" : "post",
			"data" : {
				"id":id
			},
			"dataType" : "json",
			success : function(result) {
				if(result.status == 0 ){
			$("#detail_title").html(result.data.TITLE);
					console.log(1);
					$("#detail").html(result.data.DETAIL);
				}
			},
			error : function(){
				window.location.href="error.sls";
			}
		}); 
	}
</script>
</head>
<body>
<div id="header">
		<div class="shell">
			<div id="top">
				<c:import url="../logo.jsp"></c:import>
			</div>
			<div id="navigation">
				<c:import url="../menu.jsp"></c:import>
			</div>
		</div>
</div>
<div id="container" >
	<div class="shell" id="menu" >	
		<div id="main">
		  <div class="cl">&nbsp;</div>	
			<div id="content">	
				<div class="box" style="width: 650px;">
					<div class="box-head">
						<h2 class="left">公司动态</h2>
						<div class="right">
						</div>
					</div>
					<div class="table">
					<table width="100%" border="0" cellspacing="0" cellpadding="0">
						<thead >
							<tr class="index_tr">
								<th width="65%;">标题</th>
								<th width="30%;">日期</th>
								<th width="5%;"></th>
							</tr>
						</thead>
						<tbody id="tbody">
						</tbody>
					</table>
				</div>
			</div>
		</div>
		<div id="sidebar" style="width:295px;">
			<div class="box" style="width: 300px;">
				<div class="box-head">
					<h2>具体内容</h2>
				</div>
				<div class="box-content" style="height: 57.5vh;">
					<h2 id="detail_title" style="text-align: center;font-weight: bold;">
						Welcome
					</h2>
					<p class="font_p" id="detail">
						Aikes有限公司位于长治市城区城北东街，是在高新技术应用领域中专业从事应用系统开发、信息安全服务的高新技术企业。
						长期专注于物业管理、房地产、市政运营管理等相关行业信息化领域，
						凭借多年在应用系统开发以及信息安全服务的积累的经验，信息已经成为该领域内著名的应用系统解决方案提供商。				
					</p>
					<video src="css/video/logo_photo.MP4" autoplay muted loop style="width:24%;height:24%;position:absolute;top:400px;left:870px;z-index:60;"></video>
				</div>
			<div class="cl">&nbsp;</div>			
			</div>
		</div>
		</div>
	</div>
</div>
	<div id="footer">
		<div class="shell">
			<span class="left">&copy; 2017 - Aikesls</span>
		</div>
	</div>
</body>
</html>
